-- polls the member to see if it's loaded and switches the proxy out when loaded. Requires
-- PrepareFrame event so this won't work in a tempo channel wait. Keep the play head moving
-- or use a go the frame loop.
property proxy, heromember
on beginsprite me
set the heromember of me = the member of sprite the spritenum of me
set the member of sprite the spritenum of me = member proxy
set the forecolor of sprite the spritenum of me = the forecolor of member proxy
set the backcolor of sprite the spritenum of me = the backcolor of member proxy
end
on prepareframe me
if the mediaReady of member the heromember of me then
set the member of sprite the spritenum of me = member the heromember of me
end if
end
on getPropertyDescriptionList
if the currentspritenum = 0 then
set memdefault = 0
else
set memref = the member of sprite the currentspritenum
set castlibnum = the castlibnum of memref
set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
end if
set p_list = [ ¼
#proxy: [ #comment: "Proxy Castmember:", ¼
#format: #shape, ¼
#default: memdefault ] ¼
]
return p_list
end
on getBehaviorDescription
return ¼
"Displays a designated placeholder image while media is being retrieved from the network. Allows a simple graphic (usually a shape) to be displayed while larger cast members load. Automatically replaces the proxy with actual media when the media finishes downloading. Drag this behavior to a sprite that displays a large cast member that may download slowly." & RETURN & ¼
"PARAMETERS:" & RETURN & ¼
"ò Proxy Castmember - Enter the name of the internal cast member that should serve as a placeholder."